#include "pthreadPool.hpp"
#include "task.hpp"
#include "log.hpp"
using namespace MY;
void testLog()
{
    LOG_SCREEN_STRATEGY_ENABLE;
    LOG(MY::logLevel::DEBUG) << "hello man";
    LOG(MY::logLevel::DEBUG) << "hello man";
    LOG(MY::logLevel::DEBUG) << "hello man";
    // MY::log logger;
    // logger(MY::logLevel::DEBUG,__FILE__,__LINE__)<<"hello man";
}
void testThreadPool()
{
    // MY::pthreadPool<task_t> pp;
    // MY::pthreadPool<task_t>::getInstance->
    for (int i = 0; i < 3; i++)
    {
        MY::pthreadPool<task_t>::getInstance(3)->enqueue(download);
        sleep(3);
    }
    MY::pthreadPool<task_t>::getInstance(12)->stop();
    MY::pthreadPool<task_t>::getInstance(12)->joinAll();
    // sleep(1000);
}
int main()
{
    // testLog();
    testThreadPool();
}